import pcLayout from "@/views/layoutpage/index.vue";
import commonLayout from "@/views/layoutpage/common.vue";
import i18n from "@/lang";
const { t } = i18n.global;
export default [
  {
    path: "/test",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/page/Test.vue"),
    name: "test",
    meta: {
      isAuth: false,
    },
  },
  {
    path: "/404",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/components/error-page/404.vue"),
    name: "404",
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/",
    name: t("message.router.defaultPage"),
    redirect: "/login",
  },
  {
    path: "/login",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/page/login/index.vue"),
    name: t("message.router.loginPage"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/common",
    name: t("message.router.layoutFrameWork"),
    component: pcLayout,
    children: [
      {
        path: "/common",
        name: t("message.router.mainLayout"),
        component: commonLayout,
        children: [
          {
            path: "/index",
            component: () =>
              import(/* webpackChunkName:"home" */ "@/views/home/index.vue"),
            name: t("message.router.homePage"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/knowledge/:type",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/knowledge/index.vue"
              ),
            name: t("message.router.pcKnowledge"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/knowledge/:type/:id",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/knowledge/knowledgePage.vue"
              ),
            name: t("message.router.knowledgePage"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/recyclebin",
            component: () =>
              import(/* webpackChunkName:"home" */ "@/views/recycle/index.vue"),
            name: t("message.router.pcRecycle"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          // {
          //   path: "/tools",
          //   component: () =>
          //     import(/* webpackChunkName:"home" */ "@/views/tools/index.vue"),
          //   name: t("message.router.documentToolbox"),
          //   meta: {
          //     keepAlive: true,
          //     isTab: false,
          //     isAuth: false,
          //   },
          // },
          {
            path: "/collect",
            component: () =>
              import(/* webpackChunkName:"home" */ "@/views/collect/index.vue"),
            name: t("message.router.pcFavorites"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          // {
          //   path: "/template",
          //   component: () =>
          //     import(
          //       /* webpackChunkName:"home" */ "@/views/templateC/index.vue"
          //     ),
          //   name: t("message.router.templateCenter"),
          //   meta: {
          //     keepAlive: true,
          //     isTab: false,
          //     isAuth: false,
          //   },
          // },
          {
            path: "/search",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/search/newIndex.vue"
              ),
            name: t("message.router.search"),
            meta: {
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          // {
          //     path: '/tools',
          //     component: ()=>import(/* webpackChunkName:"home" */ '@/views/knowledge/index.vue'),
          //     name: '文档工具',
          //     meta: {
          //       keepAlive: true,
          //       isTab: false,
          //       isAuth: false
          //     }
          // },
          {
            path: "/setting/control",
            component: () =>
              import(/* webpackChunkName:"home" */ "@/views/setting/index.vue"),
            name: t("message.router.console"),
            meta: {
              lang: "message.router.console",
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/knowRole",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/knowRole.vue"
              ),
            name: t("message.router.libraryPermissions"),
            meta: {
              lang: "message.router.libraryPermissions",
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/label",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/knowTag.vue"
              ),
            name: t("message.router.labelManage"),
            meta: {
              lang: "message.router.labelManage",
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          // {
          //   path: "/setting/template",
          //   component: () =>
          //     import(
          //       /* webpackChunkName:"home" */ "@/views/setting/templatePage.vue"
          //     ),
          //   name: t("message.router.staticTemplate"),
          //   meta: {
          //     lang: "message.router.staticTemplate",
          //     keepAlive: true,
          //     isTab: false,
          //     isAuth: false,
          //   },
          // },
          {
            path: "/setting/dynamic",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/templatePage.vue"
              ),
            name: t("message.router.dynamicTemplate"),
            meta: {
              lang: "message.router.dynamicTemplate",
              keepAlive: false,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/plugin",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/plugins.vue"
              ),
            name: t("message.router.pluginManage"),
            meta: {
              lang: "message.router.pluginManage",
              keepAlive: false,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/message",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/messag.vue"
              ),
            name: t("message.router.messageTemplate"),
            meta: {
              lang: "message.router.messageTemplate",
              keepAlive: false,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/messagelog",
            component: () =>
              import(
                /* webpackChunkName:"home" */ "@/views/setting/messaglog.vue"
              ),
            name: t("message.router.messageLog"),
            meta: {
              lang: "message.router.messageLog",
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
          {
            path: "/setting/api",
            component: () =>
              import(/* webpackChunkName:"home" */ "@/views/setting/api.vue"),
            name: t("message.router.interFaceDoc"),
            meta: {
              lang: "message.router.interFaceDoc",
              keepAlive: true,
              isTab: false,
              isAuth: false,
            },
          },
        ],
      },
    ],
  },
  {
    path: "/share",
    name: t("message.router.sharPage"),
    component: () =>
      import(/* webpackChunkName: "editor" */ "@/views/share/index.vue"),
    children: [
      {
        path: "/share/:shareKey",
        name: t("message.router.sharVail"),
        component: () =>
          import(/* webpackChunkName: "editor" */ "@/views/share/index.vue"),
      },
    ],
  },
  {
    path: "/detail",
    name: t("message.router.oldShar"),
    component: () =>
      import(/* webpackChunkName: "editor" */ "@/views/share/index.vue"),
    children: [
      {
        path: "/detail/:shareKey",
        name: t("message.router.oldSharVail"),
        component: () =>
          import(/* webpackChunkName: "editor" */ "@/views/share/index.vue"),
      },
    ],
  },
  {
    path: "/editor",
    name: t("message.router.docEditPage"),
    component: () =>
      import(/* webpackChunkName: "editor" */ "@/views/editor/index.vue"),
  },
  {
    path: "/editorOffice",
    name: t("message.router.officeDocEdit"),
    component: () =>
      import(/* webpackChunkName: "editor" */ "@/views/editor/office.vue"),
  },
  {
    path: "/login/callback",
    name: t("message.router.weChatScanLogin"),
    component: () =>
      import(/* webpackChunkName: "editor" */ "@/views/editor/office.vue"),
  },
  {
    path: "/login/dingtalk",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/main/dingtalk/login.vue"),
    name: t("message.router.dingTalkLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/enterpriseWechat/index",
    component: () =>
      import(
        /* webpackChunkName: "page" */ "@/views/main/enterpriseWechat/index.vue"
      ),
    name: t("message.router.autoWeComLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/login/enterpriseWechat",
    component: () =>
      import(
        /* webpackChunkName: "page" */ "@/views/main/enterpriseWechat/login.vue"
      ),
    name: t("message.router.weComLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/login/dingtalk/scanback",
    component: () =>
      import(
        /* webpackChunkName: "page" */ "@/views/main/dingtalk/scanback.vue"
      ),
    name: t("message.router.dingTalkScanLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/login/dingtalk/bindback",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/main/dingtalk/bind.vue"),
    name: t("message.router.dingTalkScanBind"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/login/own",
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/main/own/login.vue"),
    name: t("message.router.enterpriseLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: `/other/:type`,
    component: () =>
      import(/* webpackChunkName: "page" */ "@/views/main/other/login.vue"),
    name: t("message.router.tripartDock"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  {
    path: "/login/standardown",
    component: () =>
      import(
        /* webpackChunkName: "page" */ "@/views/main/standardOwn/login.vue"
      ),
    name: t("message.router.selfLogin"),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false,
    },
  },
  // {
  //   path:'/knowledgeInfo',
  //   name:"文库详情",
  // }
];
